Notatnik stanowi wizualizację danych pokazujących pozycje Galileuszowych księzyców Jowisza od 12 do 16 maja 2025. Dane są obliczone skryptem w języku Python, który używa efemeryd Horizons() z JPL Nasa:

SetDirectory[NotebookDirectory[]];

url="https://th.if.uj.edu.pl/~odrzywolek/homepage/students/aa/2025/W09/python/";

(*io=Import["python/Io_orbit_2025-05-12.csv"]//Rest;*)

(*eu=Import["python/Europa_orbit_2025-05-12.csv"]//Rest;*)

(*ga=Import["python/Ganimedes_orbit_2025-05-12.csv"]//Rest;*)

(*jup=Import["python/Jupiter_orbit_2025-05-12.csv"]//Rest;*)

io=Import[url<>"Io_orbit_2025-05-12.csv"]//Rest;
eu=Import[url<>"Europa_orbit_2025-05-12.csv"]//Rest;
ga=Import[url<>"Ganimedes_orbit_2025-05-12.csv"]//Rest;
jup=Import[url<>"Jupiter_orbit_2025-05-12.csv"]//Rest;

Import[url<>"Io_orbit_2025-05-12.csv"]//First

Manipulate[
Show[
ListPointPlot3D[io[[1;;end,{2,3,4}]]-1jup[[1;;end,{2,3,4}]],PlotStyle->Yellow],
ListPointPlot3D[eu[[1;;end,{2,3,4}]]-1jup[[1;;end,{2,3,4}]],PlotStyle->Blue],
ListPointPlot3D[ga[[1;;end,{2,3,4}]]-1jup[[1;;end,{2,3,4}]],PlotStyle->Green],
PlotRange->{{-1,1},{-1,1},{-1,1}}*1.2*10^6
],
{{end,12},1,Length[jup],1}]

Block[{end=All},Show[
ListPointPlot3D[io[[1;;end,{2,3,4}]],PlotStyle->Yellow],
ListPointPlot3D[eu[[1;;end,{2,3,4}]],PlotStyle->Blue],
ListPointPlot3D[ga[[1;;end,{2,3,4}]],PlotStyle->Green],
PlotRange->All
]
]

ExternalEvaluate[{"Python","Target" -> <|
"Dependencies" -> {"numpy","scipy","astropy","astroquery","pandas"}|>},
"import astroquery; 
print(astroquery.__version__)"
]

import astroquery
print(astroquery . __version__)

import numpy as np
np.sin(1)

from astroquery.jplhorizons import Horizons
import astropy.units as u
import pandas as pd

# ------------------------------------------------------------------
# 1.  Pick a start epoch and a span long enough for (≥) 1 Io orbit.
# ------------------------------------------------------------------
start = '2025-05-12 00:00'               # UTC calendar string
stop  = '2025-05-16 19:00'               # ≈ 43 h later
step  = '1h'                             # sample interval

io_id = 501                         # Io
eu_id = 502                         # Europa
ga_id = 503                         # Ganimedes
ca_id = 504                         # Calisto
jupiter_id = 599                         # Jupiter (planet centre)

q = Horizons(
        id=ga_id,
        location=jupiter_id,             # observer = Jupiter’s centre
        epochs={'start': start, 'stop': stop, 'step': step}
    )



vec = q.vectors()    # Astropy Table

# ---------------------------------------------------------------
# 2.  Convert units and collect what we want in a DataFrame.
#     (Horizons returns AU and AU/day;)
# ---------------------------------------------------------------
AU_KM = (1*u.au).to(u.km).value          # 149 597 870.7
DAY_S = u.day.to(u.s)                    # 86400

df = vec.to_pandas()                     # JD, x, y, z, vx, ...
df_out = pd.DataFrame({
    'JD'   : df['datetime_jd'],
    'x_km' : df['x']  * AU_KM,
    'y_km' : df['y']  * AU_KM,
    'z_km' : df['z']  * AU_KM,
    'vx_km_s': df['vx'] * AU_KM / DAY_S,
    'vy_km_s': df['vy'] * AU_KM / DAY_S,
    'vz_km_s': df['vz'] * AU_KM / DAY_S
})

# 3.  Write the file – plain CSV, no index column.
outfile = 'Ganimedes_orbit_2025-05-12.csv'
df_out.to_csv(outfile, index=False)
print(f"✅ Saved {len(df_out)} rows to {outfile}")